﻿namespace Genesis.Infrastructure.Application.Specifications
{

    public class NotSpecification<T> : Specification<T>
    {

        private ISpecification<T> primary;

        public NotSpecification(ISpecification<T> primary)
        {

            this.primary = primary;

        }

        public override bool IsSatisfiedBy(T candidate)
        {

            return !primary.IsSatisfiedBy(candidate);

        }

    }

}